-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto: fix webcrypto private/secret import with empty usages #47877
Conversation
Review requested:
|
How do we deal with the semverness of this? The keys were unusable before, they are non-importable now. It is unlikely any code depended on import of keys that weren't usable for any operation but I'm keen to get more opinions. |
Furthermore if any interoperable code uses webcrypto (kinda its whole point) it already can't depend on this as other implementations properly reject. I'm proposing to ship this is as a fix not as a breaking change. |
I'd expect near-zero breakage, so spec-compliance outweighs that concern. |
In that case this is ready for reviews. |
} | ||
|
||
throw lazyDOMException('Unrecognized algorithm name', 'NotSupportedError'); | ||
if ((result.type === 'secret' || result.type === 'private') && result.usages.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ((result.type === 'secret' || result.type === 'private') && result.usages.length === 0) { | |
if (result.type !== 'public' && result.usages.length === 0) { |
Landed in 71eda57 |
Refs: nodejs#47864 PR-URL: nodejs#47877 Refs: nodejs#47864 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Backport-PR-URL: nodejs#47336
Refs: nodejs#47864 PR-URL: nodejs#47877 Refs: nodejs#47864 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
private
andsecret
type keys are not allowed to have empty usagesRefs: #47864
cc @tniessen @fhanau